﻿using System.Collections.Generic;
using System.Linq;
using System.Windows.Controls;
using ComicTool.Drawing.Svg;

namespace ComicTool.Drawing
{
    public class TextDrawingItem : DrawingItem
    {
        private TextArea textArea;
        private List<TextBlock> blocks;

        public TextDrawingItem(TextArea ta)
        {
            textArea = ta;
        }

        protected override void Add(Canvas canvas)
        {
            if (blocks == null)
            {
                blocks = textArea.CreateBlocks().ToList();
            }
            blocks.ForEach(b => canvas.Children.Add(b));
        }

        protected override void Resize(double width, double height)
        {
        }
    }
}
